package com.macro.mall.ums.enums;

/**
 * 用户等级枚举
 *
 * @author xuyanjun
 * @date 2019-08-19
 */
public enum UserLevelEnum {

    /**
     * 小白
     */
    FANS(0, "小白"),

    /**
     * 小二
     */
    WAITER(1, "小二"),

    /**
     * 掌柜
     */
    SHOP_KEEPER(2, "掌柜"),

    /**
     * 东家
     */
    SHOP_OWNER(3, "东家");

    /**
     * 值
     */
    private int value;

    /**
     * 描述
     */
    private String description;

    UserLevelEnum(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public static UserLevelEnum enumOf(int value) {
        for (UserLevelEnum userLevelEnum : values()) {
            if (value == userLevelEnum.value) {
                return userLevelEnum;
            }
        }
        throw new IllegalArgumentException("不合法的用户等级枚举。");
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

}
